package indi.kane.demandlist.dao;

import indi.kane.demandlist.entity.Demand;
import indi.kane.demandlist.vo.DemandStatusVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DemandMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Demand record);

    int insertSelective(Demand record);

    Demand selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Demand record);

    int updateByPrimaryKey(Demand record);

    List<Demand> query(Demand record);

    @Select("SELECT * FROM Demand;")
    List<Demand> loadAll();

    @Select("SELECT Status,COUNT(*) as 'count' FROM Demand GROUP BY Status;")
    List<DemandStatusVo> summaryStatus();
}